package com.day02;

import java.util.Scanner;

public class MethodExercise {
    /**
     * 定义一个方法，进行摄氏温度的转换
     * 转换公式：c=5/9(f-32)
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入需要转换的华氏温度：");
        double fNum = Double.parseDouble(sc.nextLine());
        System.out.println("转换后的摄氏温度为：" + changeF2C(fNum));
        sc.close();
    }

    public static double changeF2C(double fNum) {
        return 5.0d / 9.0d * (fNum - 32.0d);
    }
}
